package ventanas;

import java.awt.BorderLayout;
import java.awt.Toolkit;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JToolBar;

import recursos.Sesion;
import org.jdesktop.swingx.JXImagePanel;
import org.jdesktop.swingx.JXImagePanel.Style;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.border.TitledBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import org.jdesktop.swingx.JXDatePicker;

public class FCatalogo extends JFrame{
	private static final long serialVersionUID = 1L;
	private JToolBar tbBarraH;
	private JButton btnSalir;
	private JPanel pnCentral;
	private JTextField txtCriterio;
	private JLabel lblCriterio;
	private JLabel lblDesde;
	private JLabel lblHasta;
	private JPanel pnlBusqueda;
	private JPanel pnlDatos;
	private JXImagePanel imgArticulo;
	
	public FCatalogo(){
		setVisible(true);
		setLocationRelativeTo(null);
		setSize(Toolkit.getDefaultToolkit().getScreenSize().width, Toolkit.getDefaultToolkit().getScreenSize().height-33);
		setDefaultCloseOperation(JInternalFrame.DO_NOTHING_ON_CLOSE);
		getContentPane().setLayout(new BorderLayout());
		
		tbBarraH = new JToolBar();
		tbBarraH.setFloatable(false);
		getContentPane().add(tbBarraH, BorderLayout.NORTH);
		
		btnSalir = new JButton("",Sesion.cargarIcono(Sesion.imgSalir));
		btnSalir.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				System.exit(0);
			}
		});
		tbBarraH.add(btnSalir);
		
		pnCentral = new JPanel();
		pnCentral.setLayout(null);
		getContentPane().add(pnCentral, BorderLayout.CENTER);
		
		pnlBusqueda = new JPanel();
		pnlBusqueda.setBorder(new TitledBorder(null, "Busqueda", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		pnlBusqueda.setBounds(10, 11, 446, 517);
		pnCentral.add(pnlBusqueda);
		pnlBusqueda.setLayout(null);
		
		lblCriterio = new JLabel("Criterio");
		lblCriterio.setBounds(10, 23, 87, 14);
		pnlBusqueda.add(lblCriterio);
		
		lblDesde = new JLabel("Desde:");
		lblDesde.setBounds(150, 23, 66, 14);
		pnlBusqueda.add(lblDesde);
		
		lblHasta = new JLabel("Hasta:");
		lblHasta.setBounds(293, 23, 87, 14);
		pnlBusqueda.add(lblHasta);
		
		txtCriterio = new JTextField();
		txtCriterio.setBounds(10, 37, 130, 20);
		pnlBusqueda.add(txtCriterio);
		txtCriterio.setColumns(10);
		
		JXDatePicker dtpDesde = new JXDatePicker();
		dtpDesde.setBounds(150, 36, 133, 22);
		pnlBusqueda.add(dtpDesde);
		
		JXDatePicker datePicker = new JXDatePicker();
		datePicker.setBounds(291, 36, 133, 22);
		pnlBusqueda.add(datePicker);
		
		pnlDatos = new JPanel();
		pnlDatos.setBorder(new TitledBorder(null, "Datos", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		pnlDatos.setBounds(10, 539, 446, 254);
		pnCentral.add(pnlDatos);
		pnlDatos.setLayout(null);
		
		imgArticulo = new JXImagePanel();
		imgArticulo.setStyle(Style.SCALED);
		imgArticulo.setImage(Toolkit.getDefaultToolkit().getImage("C:\\Windows\\novedades\\N00002.jpg"));
		imgArticulo.setBounds(466, 11, 1108, 782);
		pnCentral.add(imgArticulo);
		
	}
}
